<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        "use strict"
        // console.log(a); //报错
        // 1.必须申明才可以使用变量
        let a = 10;
        console.log(a);

        function fn(){
            c = 10;
        }
        fn();
        console.log(c);//报错

        // 2.相同的形参,不被允许
        function fn(a,b) {
            console.log(a,b);
        }
        fn(10,20);

        //3.严格模式下函数this指向是undefined
        function fun1() {
            
            console.log(this); 
        }
        fun1();

        function fun() {
            console.log(this.name); //王俊凯
            console.log(this); //obj
        }
        
        let obj = {
            name: '王俊凯',
            fun: fun
        }
        obj.fun();

    </script>
</body>
</html>